
version 8.0 
log using pres_runoff_endogeneity.log, replace
 #delimit ;

*     ***************************************************************** *;
*     ***************************************************************** *;
*       File-Name:      pres_runoff_endogeneity.do                      *;
*       Date:           5/18/05                                         *;
*       Author:         MRG                                             *;
*       Purpose:        Do-file to replicate results for AJPS version   *;
*                       of presidential candidates paper where          *;
*                       dependent variable is presidential candidates.  *;
*                       Addresses endogeneity issue.                    *;
*       Input File:     presidential_new.dta                            *;
*       Output File:    pres_runoff_endogeneity.log                     *;
*       Data Output:    None                                            *;
*       Previous file:                                                  *;
*       Machine:        Home                                            *;
*     ****************************************************************  *;
*     ****************************************************************  *;

set mem 10m;
set matsize 150;

use c:\ajps\presidential_new.dta;

*     ****************************************************************  *;
*                           Summary Statistics                          *;
*     ****************************************************************  *;

sum;

*     ****************************************************************  *;
*                    Relabel and Define Variables                       *;
*     ****************************************************************  *;

label var country  "countryname";
label var newdem "first election as new democracy";
label var countrynumber "countrynumber";
label var year "year";
label var regime "regime as of 31 December of given year 0=democracy 1=dictatorship";
label var regime_leg "regime type at time of legislative election 0 = democracy 1=dictatorship";
label var legelec "legislative election";
label var preselec "presidential election";
label var eighties "election in 1980s closest to 1985";
label var old "elections in countries that did not transition to democracy in 1990s";
label var nineties "elections in 1990s closest to 1995";
label var proximity1 "proximity - continuous";
label var proximity2 "proximity - dichotomous";
label var enpp "parliamentary parties - uncorrected";
label var enpp1 "parliamentary parties - corrected";
label var enep "electoral parties - uncorrected";
label var enep1 "electoral parties - corrected";
label var enpres "effective number of presidential candidates";
label var seats "assembly size";
label var districts "number of electoral districts";
label var avemag "average district magnitude";
label var medmag "median district magnitude";
label var upperseats "number of uppertier seats";
label var uppertier "percentage of uppertier seats";
label var eneg "effective number of ethnic groups  fearon";

describe;

*     ****************************************************************  *;
*     ****************************************************************  *;
*       First, how many countries have switched from plurality rule to  *;
*       a runoff system (or vice versa) in a given democratic period    *;
*       i.e. without an authoritarian interlude.  The answer is just 5. *;
*       Colombia 1994, Dominican Republic 1996, Nicaragua 1996, Uruguay *;
*       1999, Zambia 1996. What about the average effective number of   *;
*       presidential candidates under each system for each country in   *;
*       the given democratic period?                                    *;
*       Colombia: Under plurality = 2.27, under runoff = 2.78           *;
*       Dominican Republic: Under plurality = 2.61, under runoff = 2.87 *;
*       Nicaragua: Under plurality = 2.11, under runoff = 2.47          *;
*       Uruguay: Under plurality = 3.36, under runoff = 3.41            *;
*       Zambia: Under runoff = 1.58, under plurality = 1.81             *;
*     ****************************************************************  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*     ****************************************************************  *;
*       Now let's only include countries that have transitioned to      *;
*       democracy or that have always had the same electoral formula    *;
*       for electing the president.  These will be countries where      *;
*       there were no democratically-elected presidents prior to the    *;
*       adoption of the electoral formula. Thus, there can logically be *;
*       no endogeneity problem in this sample.                          *;
*     ****************************************************************  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*       Would like to drop certain countries that do not fit.           *;
*       1. Drop Kiribati - not free entry of candidates                 *;
*       2. Drop elections that ultimately use an electoral college      *;
*       to determine who wins.  This means dropping Argentina 1946,     *;
*       1958, 1963, 1983, 1989, United States (all presidential         *;
*       elections), Finland 1950, 1956, 1962, 1968, 1978, 1982.         *;
*       3. Drop Ireland (all presidential elections) and Sri Lanka      *;
*       1994, 1999 since they use STV.                                  *;
*     ****************************************************************  *;

drop if countrynumber==163;
drop if countrynumber==65;
drop if countrynumber==113;
drop if countrynumber==96;
drop if countrynumber==66 & year==1946;
drop if countrynumber==66 & year==1958;
drop if countrynumber==66 & year==1963;
drop if countrynumber==66 & year==1983;
drop if countrynumber==66 & year==1989;
drop if countrynumber==106 & year==1950;
drop if countrynumber==106 & year==1956;
drop if countrynumber==106 & year==1962;
drop if countrynumber==106 & year==1968;
drop if countrynumber==106 & year==1978;
drop if countrynumber==106 & year==1982;

*     ****************************************************************  *;
*     ****************************************************************  *;
*       Now drop observations unless they have employed the same        *;
*       electoral formula (runoff or plurality) since they have been    *;
*       classified as democratic.  Now there can be no endogeneity      *;
*       problem since there were no democratically-elected presidential *;
*       candidates prior to the adoption of the electoral formula.      *;
*     ****************************************************************  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*       Drop Colombian presidential elections since 1958.               *;
*       Drop Uruguayan presidential elections since 1989.               *;
*       Drop Dominican Republic presidential elections since 1966.      *;
*       Drop Nicaraguan presidential elections since 1984.              *;
*       Drop Zambian presidential elections since 1991.                 *;
*     ****************************************************************  *;

sum;

drop if countrynumber==70 & year>1957;
drop if countrynumber==76 & year>1988;
drop if countrynumber==54 & year>1965;
drop if countrynumber==62 & year>1983;
drop if countrynumber==47 & year>1990;

sum;

sum countrynumber if enpres>0 & enpres<200 & eneg>0 & eneg<200; 

sum countrynumber if enpres>0 & eneg>0 & eneg<300 & enpres<200 & pres_runoff==1;

sum countrynumber if enpres>0 & eneg>0 & eneg<300 & enpres<200 & pres_plurality==1;

sum enpres if enpres>0 & enpres<200 & eneg>0 & eneg<200;

sum eneg if enpres>0 & enpres<200 & eneg>0 & eneg<200;

*     ****************************************************************  *;
*       195 presidential elections left. 130 runoff, 65 plurality       *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                   Create variables ready for regressions              *;
*     ****************************************************************  *;

gen eneg_runoff = eneg*pres_runoff;

*     ****************************************************************  *;
*                               1980s                                   *;
*     ****************************************************************  *;

regress enpres eneg pres_runoff  eneg_runoff if eighties==1, robust;

matrix b=e(b);
matrix V=e(V);
scalar b1=b[1,1];
scalar b3=b[1,3];

scalar varb1=V[1,1];
scalar varb3=V[3,3];
scalar covb1b3=V[1,3];

scalar conb=b1+b3*1;
display conb;

scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);
display conse;

scalar t=conb/conse;
display t;

*     ****************************************************************  *;
*           What is the effect of eneg as runoff changes in the 1980s?  *;
*           When runoff is 0, then the effect of eneg is 0.23 (0.03)    *;
*           When runoff is 1, then the effect of eneg is 0.65 (0.32)    *;
*           Both significant, but 200% larger in runoff systems.        *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                               1990s                                   *;
*     ****************************************************************  *;

regress enpres eneg pres_runoff eneg_runoff if nineties==1, robust;

matrix b=e(b);
matrix V=e(V);
scalar b1=b[1,1];
scalar b3=b[1,3];

scalar varb1=V[1,1];
scalar varb3=V[3,3];
scalar covb1b3=V[1,3];

scalar conb=b1+b3*1;
display conb;

scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);
display conse;

scalar t=conb/conse;
display t;

*     ****************************************************************  *;
*       Effect of eneg in plurality systems is -0.21 (0.12).            *;
*       Effect of eneg in runoff systems is 0.39 (0.15).                *;
*       Thus, eneg is significant at 95% level when runoff=1            *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*       Now move on to pooled analyses                                  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                            Full Sample                                *;
*     ****************************************************************  *;

regress enpres eneg pres_runoff eneg_runoff, robust cluster(country);

matrix b=e(b);
matrix V=e(V);
scalar b1=b[1,1];
scalar b3=b[1,3];

scalar varb1=V[1,1];
scalar varb3=V[3,3];
scalar covb1b3=V[1,3];

scalar conb=b1+b3*1;
display conb;

scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);
display conse;

scalar t=conb/conse;
display t;

*     ****************************************************************  *;
*       Effect of eneg in plurality systems is -0.05 (0.08).            *;
*       Effect of eneg in runoff systems is 0.36 (0.11).                *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                       Established Democracies                         *;
*     ****************************************************************  *;

regress enpres eneg pres_runoff eneg_runoff if old==1, robust cluster(country);

matrix b=e(b);
matrix V=e(V);
scalar b1=b[1,1];
scalar b3=b[1,3];

scalar varb1=V[1,1];
scalar varb3=V[3,3];
scalar covb1b3=V[1,3];

scalar conb=b1+b3*1;
display conb;

scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);
display conse;

scalar t=conb/conse;
display t;

*     ****************************************************************  *;
*       Effect of eneg in plurality systems is -0.01 (0.16).            *;
*       Effect of eneg in runoff systems is 0.63 (0.20).                *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                       Presidential Regimes                            *;
*     ****************************************************************  *;

regress enpres eneg pres_runoff eneg_runoff if institution==3, robust cluster(country);

matrix b=e(b);
matrix V=e(V);
scalar b1=b[1,1];
scalar b3=b[1,3];

scalar varb1=V[1,1];
scalar varb3=V[3,3];
scalar covb1b3=V[1,3];

scalar conb=b1+b3*1;
display conb;

scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);
display conse;

scalar t=conb/conse;
display t;

*     ****************************************************************  *;
*       Effect of eneg in plurality systems is -0.07 (0.08).            *;
*       Effect of eneg in runoff systems is 0.56 (0.20).                *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                       Established Presidential Regimes                *;
*     ****************************************************************  *;

regress enpres eneg pres_runoff eneg_runoff if institution==3 & old==1, robust cluster(country);

matrix b=e(b);
matrix V=e(V);
scalar b1=b[1,1];
scalar b3=b[1,3];

scalar varb1=V[1,1];
scalar varb3=V[3,3];
scalar covb1b3=V[1,3];

scalar conb=b1+b3*1;
display conb;

scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);
display conse;

scalar t=conb/conse;
display t;

*     ****************************************************************  *;
*       Effect of eneg in plurality systems is -0.03 (0.15).            *;
*       Effect of eneg in runoff systems is 0.72 (0.22).                *;
*     ****************************************************************  *;


*     ****************************************************************  *;
*     ****************************************************************  *;
*                                   THE END                             *;
*     ****************************************************************  *;
*     ****************************************************************  *;


exit;
